package com.sky.mapper;

import com.sky.dto.SetmealDTO;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import com.sky.vo.DishItemVO;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {


    //根据套餐id查询套餐的菜品详情
    List<DishItemVO> getDishList(String setmealId);

    //新增套餐菜品关系
    void saveSetmealDish(List<SetmealDish> setmealDishes);

    //查询套餐中的菜品信息
    @Select("select * from setmeal_dish where setmeal_id = #{setmealId} ")
     List<SetmealDish> getSetmealDishById(Long setmealId);

    //删除多个套餐中，所有菜品
    void delete(List<Long> setmealIds);

    //根据id删除一个套餐的菜品信息
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteById(Long setmealId);
}
